* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 外部box */
.media-box {
    height: 100dvh; /* 100%视口高度 */
    width: 100%; 
    font-family: Arial, sans-serif; 
    font-size: 1rem;
    line-height: 1.7; /* 行高 */
    color: #101010;
    border-top: 6px solid #f1d23a; /* 上边框 */
    /* 背景grid网格 */
    background:
        /* fixed linear-gradient(
            transparent,
            #fff 70%), */
        fixed repeating-linear-gradient( 
            #efefef,
            #efefef 1px,
            transparent 1px,
            transparent 40px),
        fixed repeating-linear-gradient(
            to right,
            #efefef,
            #efefef 1px,
            transparent 1px,
            transparent 40px) #fff;
    padding: 2rem 3rem; /* 内边距 */

    display: grid; /* 网格布局 */
    grid-template-columns: repeat(4, 1fr); /* 4列 */
    grid-template-rows: auto 1fr auto auto; /* 4行 */
    grid-template-areas: 
    "header header header header"
    "main main main main"
    "sidebar sidebar sidebar sidebar"
    "footer footer footer footer";
    gap: 1rem; /* 间距 */
    min-height: calc(100dvh - 150px); /* 最小高度 */
}

/* 标题 */
.site-header {
    grid-area: header; /* 网格区域 */
}

/* 内容 */
.content {
    grid-area: main; /* 网格区域 */
}

/* 侧边 */
.sidebar {
    grid-area: sidebar; /* 网格区域 */
}

/* 页尾 */
.site-footer {
    grid-area: footer; /* 网格区域 */
}

.site-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直居中 */
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 500;
}

.site-nav-toggle {
    font-size: 2rem;
    border:none;
    background-color: transparent; /* 背景透明 */
    cursor: pointer; /* 光标样式 */
}

.site-nav {
    display: flex;
    justify-content: flex-end;
    gap: 1.25rem;
    display: none;
}

.site-nav a {
    font-size: 1rem;
    font-weight:500;
    color:#101010;
    text-decoration: none; /* 移除底线 */
}
.site-nav a:hover,
.site-nav-toggle:hover  {
    color: #b89900;
}

.site-nav a:focus-visible,
.site-nav-toggle:focus-visible {
    color: #b89900;
    outline: 1px dotted #b89900; /* 焦点样式 */
    outline-offset: 0.25rem; /* 焦点偏移 */
}

.content {
    grid-area: main;
    padding: 1rem 1.5rem;
}

.sidebar {
    grid-area: sidebar;
    padding: 1rem;
}

.site-footer {
    grid-area: footer;
    padding: 1rem 1.5rem;
}

.site-header,
.site-footer,
.content,
.sidebar {
    background-color: #fbf4d6;
    border: 1px solid #e7d586;
}

h1 {
    font-size: 1.5rem;
    line-height: 1.5;
    margin-block-end: 0.25em;
}

p:not(:last-child) { /* 排除最後一個p元素 */
    margin-block-end: 1em; /* 底部外边距 */
}

.widget {
    width: 100%;
    aspect-ratio: 1/0.25; /* 宽高比 */
    background-color: #ffe566;
}

.widget:not(:last-child) {
    margin-block-end: 1rem;
}

/* 媒体查询 */

@media screen and (min-width: 800px)  {
    .print-box {
        grid-template-rows: auto 1fr auto;
        grid-template-areas: 
        "header header header header"
        "main main main sidebar"
        "footer footer footer footer";
    }
    .site-nav-toggle {
        display: none;
    }
   .site-nav {
        display: flex;
    }
}